package com.ldw.service.impl;

import com.ldw.mapper.CategoryMapper;
import com.ldw.pojo.Category;
import com.ldw.service.CategoryService;
import com.ldw.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public Result categorys() {
        List<Category> categories = categoryMapper.selectList(null);
        return Result.success(categories);
    }

    @Override
    public Result categoryById(Long id) {
        return Result.success(categoryMapper.selectById(id));
    }
}
